/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:29  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;
import java.util.Set;
import java.util.LinkedHashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.EntityListeners;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_permits")
public class BpPermits implements java.io.Serializable{
    
    //columns START
    //ID
    private Long id;
    //证书名称
    private String certificateName;
    //是否有
    private String isThere;
    //起始时间
    private String initiatingDate;
    //终止时间
    private String terminatesDate;
    //
    private String permits;
    //租户ID
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //columns END


    public void setId(Long value) {
        this.id = value;
    }
    
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }
    
     
    @Column(name = "CERTIFICATE_NAME", length = 255)
    public String getCertificateName() {
        return this.certificateName;
    }
    
    public void setCertificateName(String value) {
        this.certificateName = value;
    }
    
     
    @Column(name = "IS_THERE", length = 2)
    public String getIsThere() {
        return this.isThere;
    }
    
    public void setIsThere(String value) {
        this.isThere = value;
    }
    
     
    @Column(name = "INITIATING_DATE", length = 100)
    public String getInitiatingDate() {
        return this.initiatingDate;
    }
    
    public void setInitiatingDate(String value) {
        this.initiatingDate = value;
    }
    
     
    @Column(name = "TERMINATES_DATE", length = 100)
    public String getTerminatesDate() {
        return this.terminatesDate;
    }
    
    public void setTerminatesDate(String value) {
        this.terminatesDate = value;
    }
    
     
    @Column(name = "PERMITS", length = 2000)
    public String getPermits() {
        return this.permits;
    }
    
    public void setPermits(String value) {
        this.permits = value;
    }
    
     
    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }
    
    public void setTenentId(Long value) {
        this.tenentId = value;
    }
    
     
    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }
    
    public void setOrgCode(String value) {
        this.orgCode = value;
    }
    

    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("certificateName",getCertificateName())
            .append("isThere",getIsThere())
            .append("initiatingDate",getInitiatingDate())
            .append("terminatesDate",getTerminatesDate())
            .append("permits",getPermits())
            .append("tenentId",getTenentId())
            .append("orgCode",getOrgCode())
            .toString();
    }
    
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj instanceof BpPermits == false) return false;
        if(this == obj) return true;
        BpPermits other = (BpPermits)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

